package lesson

import (
	"context"
	"server/internal/dao"
	"server/internal/model/do"
	"server/internal/model/entity"

	"server/api/lesson/voice"
)

func (c *ControllerVoice) EvaluationResult(ctx context.Context, req *voice.EvaluationResultReq) (res *voice.EvaluationResultRes, err error) {
	res = new(voice.EvaluationResultRes)
	record := entity.LessonVoiceEvaluationRecord{}
	err = dao.LessonVoiceEvaluationRecord.Ctx(ctx).Where(do.LessonVoiceEvaluationRecord{Sn: req.Sn}).Scan(&record)
	res.TotalScore = record.TotalScore
	return
}
